package stripsLanguage;

import java.util.List;

/**
 * Zawiera wszystkie dane odczytane/wygenerowane z pliku
 * Umozliwia uzyskanie planu zgodnie z algorytmem STRIPS
 * @author Lukasz
 *
 */
public class Task {

	private List<Instance> Instances;
	private List<PredicateType> PredicateTypes;
	private List<Operator> Operators;
	private Plan FirstPlan;
	
	public Task(
		List<Instance> instances,
		List<PredicateType> predicateTypes,
		List<Operator> operators,
		Plan firstPlan)
	{
		Instances = instances;
		PredicateTypes = predicateTypes;
		Operators = operators;
		FirstPlan = firstPlan;
	}
	
	public Plan getFirstPlan()
	{
		return FirstPlan;
	}
	
	public List<Operator> getOperators()
	{
		return Operators;
	}
	
	public String toString()
	{
		String s = "\n*****************\nZdefiniowane zadanie:\n";
		
		s += "Instances (nrOfType,name): ";
		for (Instance in: Instances)
			s += in.toString();

		s +=  "\nPredicateTypes (nrOfType,name,nrOfArgs): ";
		for (PredicateType p: PredicateTypes)
			s += p.toString();
	
		s +=  "\nOperators: ";
		for (Operator o: Operators)
			s += o.toString();
		
		s += FirstPlan.toString();
			
		return s;
	}

	
	public String printResults(List<Plan> plans)
	{
		String s = "";
		for(Plan p: plans)
			s += p.toString();
		return s;
	}

}
